﻿using Hzexe.Wechat.SharpSDK.Message.Request;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.IO;

namespace TestProject1
{
    
    
    /// <summary>
    ///This is a test class for RequestMessageBaseTest and is intended
    ///to contain all RequestMessageBaseTest Unit Tests
    ///</summary>
    [TestClass()]
    public class RequestMessageBaseTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Parse
        ///</summary>
        [TestMethod()]
        public void ParseTest()
        {
            var input = @" <xml>
 <ToUserName><![CDATA[toUser]]></ToUserName>
 <FromUserName><![CDATA[fromUser]]></FromUserName>
 <CreateTime>1348831860</CreateTime>
 <MsgType><![CDATA[image]]></MsgType>
 <PicUrl><![CDATA[http://www.baidu.com/a.jpg]]></PicUrl>
 <MsgId>1234567890123456</MsgId>
 </xml>";
            byte[] d = System.Text.Encoding.UTF8.GetBytes(input);

            Stream stream = new System.IO.MemoryStream(d); // TODO: Initialize to an appropriate value
            RequestMessageBase expected = null; // TODO: Initialize to an appropriate value
            RequestMessageBase actual;
            actual = RequestMessageBase.Parse(stream);
            Assert.IsNotNull(actual);

            //Assert.AreEqual(actual, expected);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
    }
}
